package sdu.attendancechecker.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import sdu.attendancechecker.dto.Teacher;
import sdu.attendancechecker.models.TeacherModel;

public class MainServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    	ArrayList<Teacher> teacherList = TeacherModel.getAll();
    	for (Teacher t : teacherList) {
    		response.getWriter().append(t.getName());
    		response.getWriter().append(t.getSurname());
    		response.getWriter().append(t.getEmail());
    		response.getWriter().append(t.getPassword());
    		response.getWriter().append("\n");
    	}
    	
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
